package cn.wolfcode.trip.base.domain;

import lombok.*;

import java.util.Date;

/**
 * at 类
 *
 * @date 2019/01/17 18:47
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class AtRecord {
    public static final int TARGET_TYPE_TRAVEL = 1; //游记中的At
    public static final int TARGET_TYPE_STRATEGY = 2; //攻略中的At
    public static final int TARGET_TYPE_COMMENT = 3; //评论中的At


    private Long id; //@记录的id

    private User senderUser; //发送者

    private User receiveUser; //接收者

    private Integer targetType; //@记录所在的位置(游记/攻略/评论等)

    private Long targetId; //@记录所在位置的id

    private Date atTime; //发生的事件

    private Boolean hasRead = false; //是否已读

    private String message;  //@的展示信息

    //targetType的展示信息
    public String getTargetTypeName() {
        switch (targetType) {
            case TARGET_TYPE_COMMENT:
                return "评论";
            case TARGET_TYPE_STRATEGY:
                return "攻略";
            case TARGET_TYPE_TRAVEL:
                return "游记";
            default:
                return "";
        }
    }
}